package com.huawei.appgallery.search.ui.card;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import com.huawei.appgallery.search.ui.cardbean.SearchRelateThemeItemCardBean;
import com.huawei.appgallery.search.ui.widget.TagTextView;
import huawei.widget.HwTextView;
import o.cgz;
import o.cuv.a;
import o.cuv.b;
import o.cuv.c;
import o.dof;
import o.eqx;

public class SearchRelateThemeListItemCard extends BaseCompositeItemCard {
    private ImageView ʻ;
    private int ʼ = 7;
    private View ʽ;
    private int ˋ = 3;
    private TagTextView ॱॱ;
    private ImageView ᐝ;

    public SearchRelateThemeListItemCard(Context context) {
        super(context);
    }

    public cgz ˏ(View view) {
        ˏ((ImageView) view.findViewById(b.ˊˋ));
        ॱ((TextView) (HwTextView) view.findViewById(b.ॱʽ));
        this.ॱॱ = (TagTextView) view.findViewById(b.ˌ);
        this.ᐝ = (ImageView) view.findViewById(b.ˊʽ);
        this.ʻ = (ImageView) view.findViewById(b.ˏˏ);
        this.ʽ = view.findViewById(b.ʽ);
        ʽ(view);
        return this;
    }

    public void w_() {
    }

    public void ˏ(CardBean cardBean) {
        if (cardBean instanceof SearchRelateThemeItemCardBean) {
            super.ˏ(cardBean);
            SearchRelateThemeItemCardBean searchRelateThemeItemCardBean = (SearchRelateThemeItemCardBean) cardBean;
            eqx.ˏ(ʼॱ(), searchRelateThemeItemCardBean.ˊ(), "image_default_icon");
            ˏ(ˊˋ(), searchRelateThemeItemCardBean.ॱ());
            String ʽ = searchRelateThemeItemCardBean.ʽ();
            this.ॱॱ.setData(ʽ, searchRelateThemeItemCardBean.ˋʻ(), dof.ॱ(ʽ) ? 0 : (int) this.ʼॱ.getResources().getDimension(a.ॱॱ));
            if (searchRelateThemeItemCardBean.ᶥ() == this.ˋ) {
                this.ᐝ.setImageResource(c.ˎ);
                this.ᐝ.setVisibility(0);
            } else if (searchRelateThemeItemCardBean.ᶥ() == this.ʼ) {
                this.ᐝ.setImageResource(c.ˏ);
                this.ᐝ.setVisibility(0);
            } else {
                this.ᐝ.setVisibility(8);
            }
            ˋ(this.ʻ, this.ʽ, searchRelateThemeItemCardBean.ॱㆍ());
        }
    }

    protected void ˋ(ImageView imageView, View view, boolean z) {
        if (ˎ()) {
            imageView.setVisibility(8);
            if (z) {
                view.setVisibility(8);
                return;
            } else {
                view.setVisibility(0);
                return;
            }
        }
        imageView.setVisibility(0);
        view.setVisibility(8);
    }
}
